//
//  QDTitleTableViewCell.swift
//  QDMetroClient
//
//  Created by YueWen on 2019/2/22.
//  Copyright © 2019 YueWen. All rights reserved.
//

import UIKit

/// 设置的cell
final class QDTitleTableViewCell: NWTableViewCell {

    /// 左侧的标题
    let titleLabel = UILabel()
    /// 左侧的描述
    let subtitleLabel = UILabel()
    /// 右侧的箭头
    let arrowImageView = UIImageView()
    
    override func buildView() {
        
        super.buildView()
        
        titleLabel.font = Font.regular.font(size: 16)
        titleLabel.textColor = QDColors.black
        titleLabel.backgroundColor = .white
        
        subtitleLabel.font = Font.light.font(size: 12)
        subtitleLabel.textAlignment = .right
        subtitleLabel.textColor = QDColors.black
        
        arrowImageView.backgroundColor = .white
        arrowImageView.contentMode = .scaleAspectFill
        arrowImageView.image = "set_arrow_right".namedImage
        
        
        contentView.addSubview(titleLabel)
        contentView.addSubview(subtitleLabel)
        contentView.addSubview(arrowImageView)
        
        bottomLineInset.left = 20
        bottomLineInset.right = 20
        bottomLineHeight = 0.5
        bottomLineView.backgroundColor = #colorLiteral(red: 0.9294117647, green: 0.9411764706, blue: 0.9333333333, alpha: 1)
    }
    
    
    override func buildLayouts() {//覆盖Mas
        
        titleLabel.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(20)
            make.height.equalTo(22)
            make.centerY.equalToSuperview().inset(0.5)
        }
        
        subtitleLabel.snp.makeConstraints { (make) in
            make.right.equalToSuperview().inset(38)
            make.centerY.equalTo(titleLabel)
            make.height.equalTo(17)
        }
        
        arrowImageView.snp.makeConstraints { (make) in
            make.width.height.equalTo(16)
            make.centerY.equalTo(titleLabel)
            make.right.equalToSuperview().inset(20)
        }
    }
}
